package com.yazi.mxz.common.service;

import com.myframework.smhj.common.exception.MyException;
import com.myframework.smhj.hibernate.dao.Service;

import com.yazi.mxz.common.entity.beans.Member;
import com.yazi.mxz.common.entity.beans.Shopping;

public interface ShoppingService extends Service<Shopping> {
	
	
	/**
	 * 添加购物车物品
	 * @param member 用户(游离对象)
	 * @param shopping 物品(构建对象)
	 */
	Shopping addByMember(Member member, Shopping shopping) throws MyException;
	
	/**
	 * 更新购物车物品购买数量
	 * @param memberId 用户ID
	 * @param shoppingId 物品ID
	 * @param buyCount 目标购买量
	 */
	void editBuyCountByMemberId(long memberId,  long shoppingId, 
			float buyCount) throws MyException;
	
	/**
	 * 删除购物车物品.
	 * @param memberId 用户ID
	 * @param shoppingIds 要删除的购物车物品IDs
	 */
	void removeByMemberId(long memberId, Long[] shoppingIds);
	
	/**
	 * 获取用户购物车物品数量
	 * @param memberId
	 * @return
	 */
	Integer countOfMemberId(long memberId);
	
	/**
	 * 获取用户购物车中某物品（商品）的数量
	 * @param memberId 用户ID
	 * @param storeGoodsId 商品ID
	 * @return
	 */
	Float countOfStoreGoodsId(long memberId, long storeGoodsId);
}
